Skip to content

[Feat] 코스 좋아요 토글 API 추가#157

Merged
howooyeon merged 4 commits into
developfrom
feat/#156-course-like
May 29, 2026
Merged

[Feat] 코스 좋아요 토글 API 추가#157
howooyeon merged 4 commits into
developfrom
feat/#156-course-like

Conversation

@pooreumjung

Copy link
Copy Markdown
Member

🧾 요약

  • 코스 상세 화면 하트 버튼 동작을 위해 코스 좋아요 토글 API 구현

🔗 이슈

✨ 변경 내용

  • CourseLike 엔티티, Repository 추가 (user_id + course_id unique 제약, 인덱스포함)
  • V26 마이그레이션 — course_likes 테이블 생성
  • CourseLikeService 구현 — 좋아요/취소 토글 (POST /api/courses/{courseId}/like)
  • CourseDetailResponse에 likedByMe 필드 추가 — 코스 상세 조회 시 좋아요 여부
    포함
  • 회원 탈퇴 시 course_likes 데이터 삭제 처리 추가

✅ 확인

  • 빌드 OK
  • 테스트 OK

@pooreumjung pooreumjung self-assigned this May 29, 2026
@pooreumjung pooreumjung added the enhancement New feature or request label May 29, 2026
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e966d81-8669-4343-aa84-ead66c2b8e4a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#156-course-like

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

본 PR은 사용자가 코스에 대해 좋아요를 표시하고 취소할 수 있는 기능을 제공하기 위해 관련 API와 데이터베이스 엔티티를 추가하는 작업을 수행했습니다. 코스 상세 조회 시 사용자의 좋아요 여부를 즉시 확인할 수 있도록 응답 구조를 개선하였으며, 데이터 정합성을 위해 회원 탈퇴 시 관련 데이터를 정리하는 로직을 포함하였습니다.

Highlights

  • 코스 좋아요 기능 구현: 사용자가 코스에 좋아요를 누르거나 취소할 수 있는 토글 API(POST /api/courses/{courseId}/like)를 구현했습니다.
  • 데이터베이스 스키마 변경: course_likes 테이블을 추가하여 사용자별 코스 좋아요 정보를 관리하며, 유니크 제약 조건과 인덱스를 적용했습니다.
  • 상세 조회 응답 개선: 코스 상세 조회 시 사용자가 해당 코스를 좋아요 했는지 여부를 확인할 수 있도록 likedByMe 필드를 추가했습니다.
  • 회원 탈퇴 처리: 회원 탈퇴 시 사용자가 좋아요를 누른 코스 데이터가 함께 삭제되도록 로직을 추가했습니다.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@howooyeon
howooyeon merged commit 807e97e into develop May 29, 2026
3 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a course "like" toggle feature, introducing the CourseLike entity, repository, service, and controller endpoints, along with database migration scripts and unit tests. The review feedback correctly identifies a transaction boundary issue in CourseLikeService: because save() defers database insertion until commit time, the local try-catch block will not catch DataIntegrityViolationException during concurrent requests. The reviewer suggests using saveAndFlush() to resolve this, along with corresponding updates to the unit tests.

@howooyeon
howooyeon deleted the feat/#156-course-like branch June 3, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 코스 좋아요 API 추가

2 participants